# Importing Data
ASIA<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Plastic/Plastics.xlsx",sheet = "Sheet1", range = "f1:f70")

# Checking the Imported Data
View(ASIA)
# Creating Time Series Data
ASIA_ts <- ts(ASIA, start=c(2006), end=c(2018), frequency=1)
# Viewing and Checking the Created Time Series Data
ASIA_ts
sum(is.na(ASIA_ts))
library(forecast)
ASIA_ts <- tsclean(ASIA_ts)
ASIA_ts

# Identification: Plotting the Time Series Data
plot(ASIA_ts)

# Estimating the appropriate model
ASIA_ts_model <- auto.arima(ASIA_ts)
ASIA_ts_model

# Forecasting
options(max.print=1000000)
ASIA_ts_forecast <- forecast (ASIA_ts_model, level=c(95), h=22)
plot(ASIA_ts_forecast)
ASIA_ts_forecast             

# Exporting
write.table(ASIA_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Plastic/ASIA_TSA.csv", sep=",")


